import { Component, signal } from "@angular/core";

@Component({
  selector: "suspense-case",
  template: `
    @defer (when condition) {
    } @placeholder {
      等待中...
    } @loading {
      加载中...
    } @error {
      加载失败
    }
  `,
})
export class SuspenseCaseComponent {
  constructor() {
    console.log("SuspenseCaseComponent constructor");
    setTimeout(() => {
      this.condition.set(false);
    }, 3000);
  }

  condition = signal(true);
}
